feat(tui): add cancel agent confirmation dialog and related functiona…#27
feat(tui): add cancel agent confirmation dialog and related functiona…#27
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis change refactors the TUI and interactive command handling to implement per-run agent context cancellation with a confirmation dialog, replacing channel-based auto-approve signaling with callback-based approval mode changes, and simplifying button styling by removing configurable spacing. Changes
Sequence DiagramsequenceDiagram
actor User
participant TUI as TUI Layer
participant Handler as Command Handler
participant Agent as Agent Runner
rect rgba(200, 150, 100, 0.5)
Note over User,Agent: Agent Cancellation Flow (New)
User->>TUI: Press Ctrl+C
TUI->>TUI: Open cancel confirmation dialog
User->>TUI: Confirm cancellation
TUI->>Handler: Send signal via cancelAgentCh
Handler->>Handler: Call s.cancelFunc()
Handler->>Agent: Context cancelled
Agent->>Handler: Stop execution, return error
Handler->>TUI: AgentDoneMsg with "context canceled"
TUI->>User: Display "⏹ Agent cancelled."
end
rect rgba(100, 150, 200, 0.5)
Note over User,Handler: Approval Mode Change Flow (New)
User->>TUI: Press Ctrl+A or click "Approve all"
TUI->>Handler: Invoke OnApprovalModeChange callback
Handler->>Handler: Update approval state
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…lity
Summary by CodeRabbit
New Features
Improvements